package com.isorf.mapper;

import com.isorf.pojo.Brand;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BrandMapper {
    @Insert("insert into brand(brand_name, brand_gender, brand_status, brand_remark) values(#{brandName}, #{brandGender}, #{brandStatus}, #{brandRemark})")
    int addBrand(Brand brand);

    @Delete("delete from brand where brand_id = #{brandId}")
    int deleteBrand(int brandId);

    @Update("update brand set brand_name = #{brandName}, brand_gender = #{brandGender}, brand_status = #{brandStatus}, brand_remark = #{brandRemark} where brand_id = #{brandId}")
    int updateBrand(Brand brand);

    @Select("select * from brand where brand_id = #{brandId}")
    Brand getBrandById(int brandId);

    @Select("select * from brand")
    List<Brand> getAllBrands();
}
